package java;

/**
 * @author:谢君臣
 * @Date:2021/8/10-16:40
 * @version:1.0
 * @function:
 */
public class 泛型 {
    public static void main(String[] args) {
        son s = new son();
        System.out.println(s instanceof father);


        father son = new son();
        son.method();
//        son.methodB();

        System.out.println("--------父类-------");
        test(new father());
        System.out.println("--------子类-------");
        test(new son());
    }
    public static void test(father a){
        if (a instanceof father) {
            System.out.println("father");
        }
        if (a instanceof son) {
            System.out.println("son");
        }
    }
}

class father{
    public void method(){
        System.out.println("Base");
    }
}
class son extends father{
    public void method(){
        System.out.println("Son");
    }
    public void methodB(){
        System.out.println("methodB");
    }
}